<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<div class="layer-warp">
    <input type="hidden" class="layerIndex2">
    <c:if test="${!empty productOrderInfo}">
        <div>
            <table class="titleTable add-table" >
                <tbody>
                <tr>
                    <th><span class="form-label ">所属订单：</span></th>
                    <td>${productOrderInfo.orderNo}</td>
                </tr>
                <tr>
                    <th><span class="form-label ">客户名称：</span></th>
                    <td> ${productOrderInfo.customerName}</td>
                </tr>
                <tr>
                    <th><span class="form-label ">签单商务：</span></th>
                    <td>${productOrderInfo.signUserName}&nbsp;${productOrderInfo.signUserOrgName}</td>
                </tr>
                <tr>
                    <th><span class="form-label ">来源事业部：</span></th>
                    <td> ${productOrderInfo.signOrgName}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </c:if>
    <div class="distribPersonel popups-info" id="allotBox">
        <table class="add-table form-table">
            <tr>
                <th><span class="form-label required">分配方式：</span></th>
                <td>
                    <div class="layui-input-inline select2-inline">
                        <select class='select-style' name="allotWay" id="allotWay">
                            <option value="">请选择</option>
                            <c:choose>
                                <c:when test="${allotWay=='SC_GENERAL_ALLOT01'}">
                                    <option value="${ALLOT_TO_FLOW_USER}">分配给生产人</option>
                                </c:when>
                                <c:when test="${allotWay=='SC_GENERAL_ALLOT02'}">
                                    <option value="${ALLOT_TO_PRODUCT_USER}">分配给负责人</option>
                                </c:when>
                                <c:otherwise>
                                    <option value="${ALLOT_TO_FLOW_USER}">分配给生产人</option>
                                    <option value="${ALLOT_TO_PRODUCT_USER}">分配给负责人</option>
                                </c:otherwise>
                            </c:choose>
                        </select>
                    </div>
                </td>
            </tr>
            <tr>
                <th><span class="form-label required">选择分配人员：</span></th>
                <td>
                    <div class="layui-input-inline select2-inline">
                        <select  id="flowUserId" name="flowUserId" class = "flowUserId">
                            <option value>请选择</option>
                        </select>
                    </div>
                </td>
            </tr>
            <tr>
                <th><span class="form-label">选择协单人员：</span></th>
                <td>
                    <div class="layui-input-inline select2-inline">
                        <select  style="width: 240px;" id="assistIdPop" name="assistIdPop" class = "assistIdPop">
                        </select>
                    </div>
                </td>
            </tr>
            <%--<tr>--%>
                <%--<th><span class="form-label">是否需办理：</span></th>--%>
                <%--<td>--%>
                    <%--<div class="layui-input-inline select2-inline">--%>
                        <%--<input type="radio" name="isNeedDispose" value="0" checked/>需要办理&nbsp;&nbsp;&nbsp;&nbsp;--%>
                        <%--<input type="radio" name="isNeedDispose" value="1"/>无需办理--%>
                    <%--</div>--%>
                <%--</td>--%>
            <%--</tr>--%>
            <tr>
                <th><span class="form-label">备注：</span></th>
                <td>
                    <textarea class="textarea-style" rows="4" name="lastRemark" id="lastRemark" placeholder="500字以内"></textarea>
                </td>
            </tr>
        </table>
    </div>
</div>
<script src="${rootUrl}/static/js/zzsc/common/sc_chooseUser.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(function(){
        $(document).ready(function () {
            areaLength($('#lastRemark'),500)
        });
        //初始化分配人员选择
        chooseUserPlug.init($('.flowUserId'),{
            url:sysInfo.basePath+'/zzsc/common/find_user_choose.do',
            width:'240px',
            // multiple:true,// 单选false或不写该参数，多选true
            otherParam:{
                /**
                 * type: 用户信息选择类型（必填）
                 *       all:全部用户，division：当前登录人所在事业部，department:当前登录人所在部门及以下，role: 查询指定角色用户，
                 * roleCode : 角色Code，（type为role时，必填）
                 * locked: 用户状态，（选填，默认全部状态）
                 *      0、正常；1、锁定；2、离职
                 *      roleCode:'ZZSC_HTMANAGER',
                 */

                type:'division',
                locked:'0'
            }
        });
        //初始化协单人员  如果有回显
        chooseUserPlug.init($('.assistIdPop'),{
            width:'240px',
            url:sysInfo.basePath+'/zzsc/common/find_user_choose.do',
            multiple:true,// 单选false或不写该参数，多选true
            allowClear:false,
            otherParam:{
                /**
                 * type: 用户信息选择类型（必填）
                 *       all:全部用户，division：当前登录人所在事业部，department:当前登录人所在部门及以下，role: 查询指定角色用户，
                 * roleCode : 角色Code，（type为role时，必填）
                 * locked: 用户状态，（选填，默认全部状态）
                 *      0、正常；1、锁定；2、离职
                 */
                type:'division',
                locked:0
            },
            yesFun:function () {
                dgg.relocation($('.layerIndex2').val());
            }
        });
        var ids = '${ids}';
        var idStr = ids.split(",");
        $("#assistIdPop").val(idStr).trigger("change");
        $('#assistIdPop').on('select2:select',function () {
            dgg.relocation($('.layerIndex2').val());
        });
    });
</script>